Skip to content

[DX] Add Prettier for code formatting#947

Open
Bharath314 wants to merge 2 commits intolayer5io:masterfrom
Bharath314:formatter
Open

[DX] Add Prettier for code formatting#947
Bharath314 wants to merge 2 commits intolayer5io:masterfrom
Bharath314:formatter

Conversation

@Bharath314
Copy link
Copy Markdown
Contributor

Notes for Reviewers

This PR fixes #91

I used the same .prettierrc as layer5/sistent

Signed commits

  • Yes, I signed my commits.

Signed-off-by: Bharath Valaboju <69413757+Bharath314@users.noreply.github.com>
@netlify
Copy link
Copy Markdown

netlify bot commented Apr 15, 2026

Deploy Preview for bejewelled-pegasus-b0ce81 ready!

Name Link
🔨 Latest commit f420f27
🔍 Latest deploy log https://app.netlify.com/projects/bejewelled-pegasus-b0ce81/deploys/69e09742af9488000823c9fc
😎 Deploy Preview https://deploy-preview-947--bejewelled-pegasus-b0ce81.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces Prettier for code formatting by adding configuration files and dependencies. However, the versions for prettier and its organize-imports plugin are invalid, leading to an incorrect typescript version in the lockfile. Feedback recommends using stable versions and adding npm scripts to improve the developer experience.

Comment thread package.json
Comment on lines +36 to +38
"postcss-cli": "^11.0.0",
"prettier": "3.8.3",
"prettier-plugin-organize-imports": "^4.3.0"
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

There are a few issues with the added dependencies:

  1. Invalid Versions: The versions specified for prettier (3.8.3) and prettier-plugin-organize-imports (^4.3.0) do not exist on the npm registry. This will cause installation failures. Please use valid, stable versions (e.g., prettier@3.5.0 and prettier-plugin-organize-imports@4.1.1).
  2. Missing Scripts: To fulfill the "DX" (Developer Experience) goal of this PR, you should add npm scripts to the scripts section of package.json. For example:
    "format": "prettier --write .",
    "format:check": "prettier --check ."
  3. Stability: It is recommended to use a stable, exact version for Prettier to ensure consistent formatting across different environments and avoid unexpected changes during updates.
Suggested change
"postcss-cli": "^11.0.0",
"prettier": "3.8.3",
"prettier-plugin-organize-imports": "^4.3.0"
"postcss-cli": "^11.0.0",
"prettier": "3.5.0",
"prettier-plugin-organize-imports": "^4.1.1"

Copy link
Copy Markdown
Contributor Author

@Bharath314 Bharath314 Apr 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like those versions of prettier and the plugin aren't in gemini's training data yet 😆 . Should I add the npm scripts? That does look like a good idea.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add script and make command also

Comment thread package-lock.json
}
},
"node_modules/typescript": {
"version": "6.0.2",
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

The version 6.0.2 for typescript is invalid as the current major version is 5. This likely indicates an issue with the dependency resolution or a typo during the lockfile generation, possibly caused by the invalid versions specified in package.json. Regenerating the lockfile after correcting the devDependencies should resolve this.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 15, 2026

🚀 Preview deployment for PR #947

🌐 Preview URL: https://layer5io.github.io/docs/pr-preview/pr-947/

This preview will be updated automatically when you push new commits to this PR.

Comment thread package.json
Comment on lines +36 to +38
"postcss-cli": "^11.0.0",
"prettier": "3.8.3",
"prettier-plugin-organize-imports": "^4.3.0"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add script and make command also

Signed-off-by: Bharath Valaboju <69413757+Bharath314@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Chore] add a code formatter config to keep the code style consistent?

2 participants